<?php
require_once "data/dao/CountryDAO.php";

/**
 * User class used to define a user using details
 * from facebook
 * 
 * @param $id
 * @param $firstname
 * @param $lastname
 * @param $profilePicSmallUrl
 * @param $profilePicBigUrl
 * @param $wiiCode
 * 
 * @author Matt Makins - 2007/12/30
 */
class User{
	
	private $id;
	private $firstname;
	private $lastname;
	private $profilePicSmallUrl;
	private $profilePicBigUrl;
	private $wiiCode;
	private $location;
	private $storeLocation;
	
	public function User($id, $firstname, $lastname, $profilePicSmallUrl,
		$profilePicBigUrl, $wiiCode, $location, $storeLocation){
		
		$this->id = $id;
		$this->firstname = $firstname;
		$this->lastname = $lastname;
		$this->profilePicSmallUrl = $profilePicSmallUrl;
		$this->profilePicBigUrl = $profilePicBigUrl;		
		$this->wiiCode = $wiiCode;
		$this->location = $location;
		$this->storeLocation = $storeLocation;
	}
	
	public function getUserId(){
		return $this->id;
	}

	public function getFirstName(){
		return $this->firstname;
	}
	
	public function getLastName(){
		return $this->lastname;
	}
	
	public function getProfilePicSmallUrl(){
		return urldecode($this->profilePicSmallUrl);
	}

	public function getProfilePicBigUrl(){
		return urldecode($this->profilePicBigUrl);
	}
	
	public function getWiiCode(){
		return $this->wiiCode;
	}

	/*
	 * ISO 3166 A2
	 */
	public function getLocationISO3166A2(){
		
		return $this->location;
	}
	
	public function getLocationString(){
		
		$cdao = new CountryDAO();
		$cm =  $cdao->getCountryMap();
		return $cm[$this->location];
	}
	
	public function getStoreLocation(){
		return $this->storeLocation;
	}
}
?>
